package main

import (
	"fmt"
	"io/ioutil"
)

/**
 * @author: guangcheng
 * @date:   2020/11/26 16:17
 * @version  V1.0
 * @description: 喜欢是藏不住的: 傻帽,不能轻易流露出喜欢一个人的情绪和行为
 *
 */
func main() {
	//将d:/abc.txt 文件内容导入到  e:/kkk.txt
	//1. 首先将  d:/abc.txt 内容读取到内存
	//2. 将读取到的内容写入 e:/kkk.txt
	srcPath := "d:/gofilewrite.txt"
	destPath := "d:/gofilewritedest.txt"
	data, err := ioutil.ReadFile(srcPath)
	if err != nil {
		//说明读取文件有错误
		fmt.Printf("read file err=%v\n", err)
		return
	}
	err = ioutil.WriteFile(destPath, data, 0666)
	if err != nil {
		fmt.Printf("write file error=%v\n", err)
	}
}
